package com.yunji.base.dao.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yunji.base.dao.IMalfunctionDao;
import com.yunji.base.domain.MalfunctionDO;
import com.yunji.base.mapper.IMalfunctionMapper;
import com.yunji.common.base.BaseDaoImpl;
import com.yunji.common.model.params.MalfunctionParam;
import com.yunji.common.utils.bean.BeanUtils;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.message.dao.impl
 * @Title: MalfunctionDaoImpl
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-10-30 14:30:48      V1.0        HuaAo       新建类
 */
@Repository
public class MalfunctionDaoImpl extends BaseDaoImpl<IMalfunctionMapper, MalfunctionDO> implements IMalfunctionDao {

    @Override
    public List<MalfunctionDO> search(MalfunctionParam param) {
        return pageList(param, new LambdaQueryWrapper<MalfunctionDO>()
                .like(BeanUtils.isNotNull(param.getMalfunctionName()), MalfunctionDO::getMalfunctionName, param.getMalfunctionName())
                .orderByAsc(MalfunctionDO::getSort));
    }
}